<?php

use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Command\Menu\Install;

/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
| console.php 文件是您可以定义所有基于闭包的控制台命令的地方。
| 每个闭包都绑定到一个命令实例，允许使用一种简单的方法与每个命令的进行 IO 交互。
| 尽管这个文件没有定义 HTTP 路由，但是它定义了应用程序中基于控制台的入口点（路由）。
*/

Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');


// 初始化后台菜单结构
Artisan::command('installMenus', function () {
    if (file_exists(base_path('commands/Menu/install.lock'))) {
        $this->comment('已安装,请勿重复运行');
        return false;
    }
    $this->newLine(3);
    $res = new Install;
    $this->comment($res($this, $this->output));
    $this->newLine(3);
})->describe('安装默认的 Admin 菜单数据');